<template>
  <div>
    <span>{{ plusOne }}</span>
    <button @click="plusOne++">change</button>
  </div>
</template>

<script>
import { reactive, ref, toRefs, computed } from "vue";
export default {
  setup() {
    const count = ref(1);
    // const plusOne = computed(() => count.value++);
    const plusOne = computed({
      get: () => count.value + 1,
      set: (val) => (count.value = val),
    });

    console.log(plusOne.value); // 2

    return {
      plusOne,
    };
  },
};
</script>

<style>
</style>